public class Draw {
    public int h;

    public int getH() {
        return h;
    }
    public void Drawsan(){
        if (h < 3){
            System.out.println("高度小于3，退出");
            return;
        }
        for (int i = 1;i <= h;i++){

            for (int j = 0;j < h - i;j++){
                System.out.print(" ");
            }
            for (int k = 0;k < (2 * i - 1);k++){
                System.out.print("*");
            }
            System.out.println();
        }
    }
    public void Drawju(){
        if (h < 3){
            System.out.println("高度小于3，退出");
            return;
        }
        for (int i = 1;i <= h;i++){
            for (int j = 1;j <= 3;j++){
                System.out.print("*");
            }
            System.out.println();
        }
    }
    public void Drawzheng(){
        if (h < 3){
            System.out.println("高度小于3，退出");
            return;
        }
        for (int i = 1;i <= h;i++){
            for (int j = 1;j <=h;j++){
                System.out.print("*");
            }
            System.out.println("");
        }
    }
    public void Drawping(){
        if (h < 3){
            System.out.println("高度小于3，退出");
            return;
        }
        for (int i = 1;i <= h;i++){
            for (int j = 0;j < h - i;j++){
                System.out.print(" ");
            }
            for (int k = 1;k <= 9;k++){
                System.out.print("*");
            }
            System.out.println();
        }
    }

    public static void main(String[] args) {
        Draw draw = new Draw();
        draw.h = 4;
        draw.Drawsan();
        draw.Drawju();
        draw.Drawzheng();
        draw.Drawping();
    }
}
